package cn.kgc.service.impl;

import cn.kgc.bean.pojo.CUser;
import cn.kgc.mapper.UserManagerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserManagerServiceImpl implements cn.kgc.service.UserManagerService {
    @Autowired
    private UserManagerMapper umm;
    @Override
    public List<CUser> selectAll() {
        return umm.selectAll();
    }

    @Override
    public boolean addUser(CUser cUser) {
        if (umm.addUser(cUser) > 0){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteUserById(long id) {
        if (umm.deleteUserById(id) > 0){
            return true;
        }
        return false;
    }

    @Override
    public CUser selectAllById(long id) {

        return umm.selectAllById(id);
    }

    @Override
    public boolean updateUser(CUser cUser) {
        if (umm.updateUser(cUser) > 0){
            return true;
        }
        return false;
    }
}
